﻿using System.Collections.Generic;
using System.Linq;

namespace GpgCore.Products
{
    public partial class FactoryScheme
    {
        public ProductType OutputProduct;
        public ProductType InputProduct1;
        public ProductType InputProduct2;
        public ProductType InputProduct3;

        public int OutputProdCountPerWorker;
        public int InputProdCountPerWorker1;
        public int InputProdCountPerWorker2;
        public int InputProdCountPerWorker3;

        public int WorkersPerLevel;
    }

    public partial class FactoryScheme
    {
        public static List<FactoryScheme> Schemes;
        public static FactoryScheme FindScheme(ProductType product)
        {
            return Schemes.FirstOrDefault(p => p.OutputProduct == product);
        }

        static FactoryScheme()
        {
            Schemes = new List<FactoryScheme>();
            FillSchemesByStaticData();
        }

        private static void FillSchemesByStaticData()
        {
            Schemes.Add(new FactoryScheme
                            {
                                OutputProduct = ProductType.Food,
                                InputProduct1 = ProductType.Wheat,
                                InputProduct2 = ProductType.None,
                                InputProduct3 = ProductType.None,

                                OutputProdCountPerWorker = 30,
                                InputProdCountPerWorker1 = 30,

                                WorkersPerLevel = 3000
                            });    

            Schemes.Add(new FactoryScheme
                            {
                                OutputProduct = ProductType.Steal,
                                InputProduct1 = ProductType.IronOre,
                                InputProduct2 = ProductType.Coal,
                                InputProduct3 = ProductType.None,

                                OutputProdCountPerWorker = 8,
                                InputProdCountPerWorker1 = 10,
                                InputProdCountPerWorker2 = 10,

                                WorkersPerLevel = 5000
                            });    
            Schemes.Add(new FactoryScheme
                            {
                                OutputProduct = ProductType.Plastic,
                                InputProduct1 = ProductType.Oil,
                                InputProduct2 = ProductType.None,
                                InputProduct3 = ProductType.None,

                                OutputProdCountPerWorker = 40,
                                InputProdCountPerWorker1 = 50,

                                WorkersPerLevel = 5000
                            });    
            Schemes.Add(new FactoryScheme
                            {
                                OutputProduct = ProductType.Medicals,
                                InputProduct1 = ProductType.Plastic,
                                InputProduct2 = ProductType.MedHerbals,
                                InputProduct3 = ProductType.None,

                                OutputProdCountPerWorker = 35,
                                InputProdCountPerWorker1 = 10,
                                InputProdCountPerWorker2 = 50,

                                WorkersPerLevel = 5000
                            });    
        }
    }
}
